layui.use(["layer","laypage"],function () {
    var layer=layui.layer,layPage=layui.laypage;
    var index=parent.layer.getFrameIndex(window.name);
    $(".demo-icon").on("click",function () {
       var htm=$(this).find("span").html();
       console.log(htm);
       parent.$("input[name='image']").val(htm);
       parent.$("#custom-icon").attr("class",htm);
       parent.layer.close(index);
    });
    /**page分页**/
    var count=$("input[name='totalElements']").eq(0).val();//一共多少条数据
    layPage.render({
        elem:"layPage",
        count:parseInt(count),
        curr:parseInt($("input[name='current']").eq(0).val()),
        groups: 5, //连续显示分页数
        theme:"#1e9fff",
        limit:parseInt($("input[name='rows']").eq(0).val()),
        limits:[50,100],
        skip:true,
        jump:function (obj,first) {//获取当前选中的页
            $("input[name='current']").eq(0).val(obj.curr);
            $("input[name='rows']").eq(0).val(obj.limit);
            if(!first){
                $(".myui-form-search").eq(0).submit();
            }
        }
    });
});
    